package org.example.stream.demo;

import org.example.stream.demo.entity.User;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class CollectMain {
    public static void main(String[] args) {
        List<User> list = UserBuilder.bindings();

        Map<String, List<User>> collect = list.stream().collect(Collectors.groupingBy(User::getName));
        System.out.println(collect);
    }
}
